]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
messageTray: Ensure _updateDatetimeId idle callback is cancelled
authorPhilip Withnall <pwithnall@gnome.org>
Tue, 28 May 2024 17:05:10 +0000 (18:05 +0100)
committerMarge Bot <marge-bot@gnome.org>
Tue, 28 May 2024 18:06:32 +0000 (18:06 +0000)
If the idle callback is not explicitly removed when the notification is
destroyed, it may be invoked after destruction, and try to modify the
notification after it’s been freed.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3352>

js/ui/messageTray.js

index d88ef4223f7ca8570e714afaf90434c5ad31a33d..fc07ab4eca48a58fce1915a4c1fdba86b64cf802 100644 (file)
@@ -475,6 +475,11 @@ export class Notification extends GObject.Object {
 
     destroy(reason = NotificationDestroyedReason.DISMISSED) {
         this.emit('destroy', reason);
+
+        if (this._updateDatetimeId)
+            GLib.source_remove(this._updateDatetimeId);
+        delete this._updateDatetimeId;
+
         this.run_dispose();
     }
 }